package com.itheima.service.impl;

import com.itheima.mapper.WorkMapper;
import com.itheima.pojo.Assignment;
import com.itheima.pojo.NoWorkStudent;
import com.itheima.pojo.UserAndWork;
import com.itheima.pojo.dto.NoWorkDTO;
import com.itheima.pojo.dto.WorkDTO;
import com.itheima.service.WorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

@Service
@Transactional
public class WorkServiceImpl implements WorkService {

    @Autowired
    private WorkMapper workMapper;

    @Override
    public boolean save(Assignment assignment) {
        return workMapper.save(assignment) > 0;
    }

    @Override
    public List<UserAndWork> selectWorkByTypeAndTime(WorkDTO workDTO) {
        return workMapper.selectWorkByTypeAndTime(workDTO);
    }

    @Override
    public List<NoWorkStudent> findNotWorkByTime(NoWorkDTO noWorkDTO) {
        return workMapper.findNotWorkByTime(noWorkDTO);
    }


}
